package com.zhhtech.zhh.api.core;

import com.alibaba.fastjson.annotation.JSONField;
import com.zhhtech.zhh.api.core.base.IResult;

public class WrapResultTBean<T> implements IResult<T> {
    private int code = -1;
    private String message = null;
    private Long time = null;
    private T data = null;

    @Override
    public boolean isOk() {
        return code == ResultBean.SUCCESS;
    }

    @Override
    public T getTData() {
        return data;
    }

    @Override
    public String getErrorMsg() {
        return message;
    }

    public int getCode() {
        return code;
    }

    @JSONField(name = "res_code")
    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }
}
